﻿using Microsoft.VisualStudio.TestTools.Common;
using Microsoft.VisualStudio.TestTools.Vsip;
using System;
using System.ComponentModel;
using System.Drawing;
using System.Runtime.CompilerServices;
using System.Windows.Forms;


namespace MolesVS2012.Host.Agent
{
    internal sealed class MolesRunConfigurationCustomHostEditor : UserControl, IRunConfigurationCustomHostEditor, IRunConfigurationEditor
    {
        // Fields
        private IContainer components;
        private ToolTip toolTip;

        // Events
        public event EventHandler DataGetDirty;

        // Methods
        public MolesRunConfigurationCustomHostEditor()
        {
            this.InitializeComponent();
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            this.toolTip = new ToolTip(this.components);
            Label label = new Label();
            base.SuspendLayout();
            label.AutoSize = true;
            label.Location = new Point(3, 9);
            label.Name = "label1";
            label.Size = new Size(0x1cd, 13);
            label.TabIndex = 2;
            label.Text = "Please use the Microsoft.Moles.Framework.MolesSettingsAttribute attribute to configure the host.";
            base.Controls.Add(label);
            base.Name = "MolesRunConfigurationCustomHostEditor";
            base.Size = new Size(0x1dc, 0x22);
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        IHostSpecificRunConfigurationData IRunConfigurationCustomHostEditor.GetData()
        {
            return null;
        }

        void IRunConfigurationCustomHostEditor.SetData(IHostSpecificRunConfigurationData data)
        {
        }

        void IRunConfigurationEditor.Initialize(IServiceProvider serviceProvider, TestRun run)
        {
        }

        void IRunConfigurationEditor.OnCommonDataDirty(object sender, CommonRunConfigurationDirtyEventArgs dirtyEventArgs)
        {
        }

        bool IRunConfigurationEditor.VerifyData()
        {
            return true;
        }

        private void OnDataGetDirty(EventArgs args)
        {
            EventHandler dataGetDirty = this.DataGetDirty;
            if (dataGetDirty != null)
            {
                dataGetDirty(this, args);
            }
        }

        // Properties
        string IRunConfigurationCustomHostEditor.HostType
        {
            get
            {
                return "Moles";
            }
        }

        string IRunConfigurationEditor.Description
        {
            get
            {
                return "Microsoft Moles 2010 Host";
            }
        }

        string IRunConfigurationEditor.HelpKeyword
        {
            get
            {
                return "Moles";
            }
        }
    }


}
